<?php
/**
 * signout.php 退出
 * Jack通过该页面退出系统。
 */
# Silence is golden.
require_once 'setting.php';
require_once 'smarty.php';

# start the session function
if (!isset($_SESSION)) {
	session_start();
}

$smarty = new MySmarty();

# delete cookies
setcookie('username', "", time() - $cookielife, "/");
setcookie('password', "", time() - $cookielife, "/");

# delete session "user"
unset($_SESSION['user']);
$_SESSION = array();

# destroy sessions
session_destroy();

header("Location: index.php");
?>